import { ClassSerializerInterceptor, Module } from '@nestjs/common'
import { ConfigModule } from '@nestjs/config'
import { TypeOrmModule } from '@nestjs/typeorm'
import { AuthModule } from './auth/auth.module'
import { UserModule } from './user/user.module'

import configuration from './config/configuration'
import { APP_INTERCEPTOR } from '@nestjs/core'
import { UploadModule } from './upload/upload.module'

@Module({
  imports: [
    TypeOrmModule.forRoot({ entityPrefix: 'T_' }),
    ConfigModule.forRoot({
      isGlobal: true,
      load: [configuration]
    }),
    UserModule,
    AuthModule,
    UploadModule
  ],
  providers: [
    {
      provide: APP_INTERCEPTOR,
      useClass: ClassSerializerInterceptor
    }
  ]
})
export class AppModule {}
